package com.wn.ticket.service.impl;


import com.wn.ticket.entity.District;
import com.wn.ticket.mapper.DistrictMapper;
import com.wn.ticket.service.DistrictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class DistrictServiceImpl implements DistrictService {
    @Autowired
    private DistrictMapper districtMapper;


    @Override
    public List<District> SelectByPid(Integer pid) {
        return districtMapper.selectByPid(pid);
    }

    @Override
    public List<Object> getByType() {
     List<District> province=  districtMapper.getByType(1);
     List<District> city=districtMapper.getByType(2);
     List<District> area=districtMapper.getByType(3);
     List<Object> address=new ArrayList<>();
     address.add(province);
     address.add(city);
     address.add(area);
        return address;
    }


}
